package com.hank.biz.sms;

import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.bpm.model.xml.type.ModelElementType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by Handle on 2017/3/5.
 */
public class SendSMSJavaDelegate implements JavaDelegate {
    private static final Logger logger = LoggerFactory.getLogger(SendSMSJavaDelegate.class);

    public void execute(DelegateExecution delegateExecution) throws Exception {
        boolean buyed = (Boolean) delegateExecution.getVariable("buyed");
        logger.info("buyed value is " + buyed);
        logger.info("Send message from SendSMSJavaDelegate");
        RuntimeService runtimeService = delegateExecution.getProcessEngineServices().getRuntimeService();
        ModelElementType elementType = delegateExecution.getBpmnModelElementInstance().getExtensionElements().getElementType();
        logger.debug(elementType.toString());
    }
}
